package com.barneyx.mshinfoplatform.entity.store;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.barneyx.mshinfoplatform.entity.AreaCommonEntity;
import com.barneyx.mshinfoplatform.entity.enums.EStoreState;
import com.barneyx.mshinfoplatform.entity.user.UserEntity;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableCharset;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableEngine;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlCharsetConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlEngineConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "msh_store_list", autoResultMap = true)
@TableCharset(MySqlCharsetConstant.UTF8MB4)
@TableEngine(value = MySqlEngineConstant.InnoDB)
@Slf4j
public class StoreEntity extends AreaCommonEntity {
    @TableId(value = "store_id", type = IdType.ASSIGN_ID)
    @Column(type = MySqlTypeConstant.BIGINT)
    private String StoreId;

    @TableField("store_cate_id")
    @Column(type = MySqlTypeConstant.BIGINT)
    private String StoreCateId;

    @TableField(exist = false)
    private StoreCateEntity StoreCate;

    @TableField("store_name")
    private String StoreName;

    @TableField("store_is_top")
    @Column(type = MySqlTypeConstant.BIT)
    private Boolean StoreIsTop;

    @TableField("store_time")
    @Column(comment = "店铺营业时间")
    private String StoreTime;

    @TableField("store_state")
    @Column(type = MySqlTypeConstant.TINYINT, defaultValue = "1")
    private EStoreState StoreState;

    @TableField("store_expires")
    @Column(type = MySqlTypeConstant.DATETIME, comment = "店铺过期时间")
    private Date StoreExpires;

    @TableField("store_tel")
    @Column(type = MySqlTypeConstant.CHAR, length = 13)
    private String StoreTel;

    @TableField("store_tel2")
    @Column(type = MySqlTypeConstant.CHAR, length = 13)
    private String StoreTel2;

    @TableField("store_cover")
    @Column(type = MySqlTypeConstant.CHAR)
    private String StoreConver;

    @TableField(value = "store_tags", typeHandler = JacksonTypeHandler.class)
    @Column(type = MySqlTypeConstant.JSON)
    private List<String> StoreTags;

    @TableField("user_id")
    @Column(type = MySqlTypeConstant.BIGINT)
    private String UserId;

    @TableField(exist = false)
    private UserEntity User;

    @TableField("store_click")
    @Column(type = MySqlTypeConstant.BIGINT)
    private String StoreClick;


    @TableField("store_desc")
    private String StoreDesc;

    @TableField("store_map_pointer")
    @Column(type = MySqlTypeConstant.CHAR)
    private String StoreMapPointer;


    @TableField("store_zan")
    @Column(type = MySqlTypeConstant.BIGINT)
    private String StoreZanCount;


    @TableField("store_addr")
    private String StoreAddr;

}
